<?php 
namespace app\admin\service;


use app\admin\model\InviteConfig;

/**
 * 邀请配置管理-服务类
 * @author 小树林
 * @since: 2023/12/25
 * Class InviteConfigService
 * @package app\admin\service
 */
class InviteConfigService extends BaseService
{
    /**
     * 构造函数
     * LevelService constructor.
     */
    public function __construct()
    {
        $this->model = new InviteConfig();
    }
	
	/**
     * 获取数据列表
     * @return array
     * @since 2023/12/25
     * @author 小树林
     */
    public function getList()
    {



        // 查询条件
        $map = [];
		
	

	
        $field = '*';
        $with = [];
        $sort = '';

        return parent::getList($map,$field,$with,$sort); // TODO: Change the autogenerated stub
    }

    public function edit()
    {
        // 请求参数
        $data = request()->param();
        // 用户名
        $id = getter($data, "id", 0);

        $data['yx_status']= implode(',', $data['yx_status']);


        $result = $this->model->edit($data, $error);
        return message();
    }
    public function info()
    {
        // 记录ID
        $id = request()->param("id", 0);
        $info = [];
        if ($id) {
            $info = $this->model->getInfo($id);
            $info['yx_status']=explode(',',$info['yx_status']);
        }
        return message("操作成功", true, $info);
    }
                                                
}